package com.sh.data.engine.common.enumDefinition;

import lombok.Getter;

@Getter
public enum RoleEnum {
    SUPER_ADMIN(1, "超级管理员"),
    PROJECT_OWNER(2, "空间所有者"),
    PROJECT_ADMIN(3, "空间管理员"),
    DATA_DEVELOP(4, "数据开发"),
    DATA_MAINTENANCE(5, "数据运维"),
    GUEST(6, "访客");

    private final String description;
    private final Integer status;

    RoleEnum(Integer status, String description) {
        this.status = status;
        this.description = description;
    }

    public static RoleEnum fromStatus(Integer status) {
        for (RoleEnum roleEnum : RoleEnum.values()) {
            if (roleEnum.getStatus().equals(status)) {
                return roleEnum;
            }
        }
        return null;
    }
}
